/*
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-05-01 10:04:58
 * @LastEditTime: 2022-05-04 11:16:59
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description: 
 */
import { INCREASE, REDUCTION } from '../constant'
export default function countRedux(preState = 0, action) {
  const { type, num } = action
  switch (type) {
    case INCREASE:
      return preState + num * 1
    case REDUCTION:
      return preState - num
    default:
      return preState
  }
}